﻿
@model Sharp.WebBooter.Areas.CMS.Models.UserViewModel
<div class="modal">
    <div class="modal-dialog">
        <div class="modal-content animated flipInY">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>
                <h4 class="modal-title" id="myModalLabel">@Model.PageTitle</h4>
            </div>
            <div class="modal-body" id="modalcontent">
                @using (Html.Bootstrap().BeginForm(c => c.Horizontal()))
                {
                    @Html.ValidationSummary()
                    <div class="form-group">
                        @Html.LabelFor(m => m.UserName, new { @class = "col-sm-2 control-label" })
                        <div class="col-sm-10">
                            @if ((bool)ViewBag.EditUserNameAble)
                            {
                                @Html.Bootstrap().TextBoxFor(m => m.UserName).Placeholder("请输入用户名")
                            }
                            else
                            {
                                @Html.DisplayFor(m => m.UserName)
                            }
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(m => m.Password, new { @class = "col-sm-2 control-label" })
                        <div class="col-sm-10">
                            @Html.Bootstrap().PasswordFor(m => m.Password).Placeholder("请输入密码")
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-sm-2 control-label" })
                        <div class="col-sm-10">
                            @Html.Bootstrap().PasswordFor(m => m.ConfirmPassword).Placeholder("请输入确认密码")
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(m => m.UserGroupIds, new { @class = "col-sm-2 control-label" })
                        <div class="col-sm-10">
                            @{
                                foreach (var item in Model.UserGroupList)
                                {
                                    var selected = Model.UserGroupIds.Contains(item.Id) ? "checked" : "";
                                    <label class="">
                                        <input name="UserGroupIds" type="checkbox" title="@item.Title" @selected value="@item.Id" />
                                        @item.Title
                                    </label>
                                }
                            }
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(m => m.EMail, new { @class = "col-sm-2 control-label" })
                        <div class="col-sm-10">
                            @Html.Bootstrap().TextBoxFor(m => m.EMail)
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(m => m.Profile.QQ, new { @class = "col-sm-2 control-label" })
                        <div class="col-sm-10">
                            @Html.Bootstrap().TextBoxFor(m => m.Profile.QQ)
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(m => m.Profile.Wechart, new { @class = "col-sm-2 control-label" })
                        <div class="col-sm-10">
                            @Html.Bootstrap().TextBoxFor(m => m.Profile.Wechart)
                        </div>
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(m => m.Comment, new { @class = "col-sm-2 control-label" })
                        <div class="col-sm-10">
                            @Html.Bootstrap().TextareaFor(m => m.Comment)
                        </div>
                    </div>
                    @Html.HiddenFor(x => x.Id)
                                }
            </div>
            <div class="modal-footer">
                @Html.Bootstrap().Button("保存").Style(BootstrapStyle.Primary).Click("window.app.saveForm(event,'" + @Url.Action("Save") + "');")
                @Html.Bootstrap().Button("关闭").Style(BootstrapStyle.Default).Attribute("data-dismiss", "modal")
            </div>
        </div>
    </div>
</div>